<!DOCTYPE html>
<html lang="en">
    <head>
        <title>下载页面</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <link rel="stylesheet" href="__STATIC__/css/new-index.css">
        <link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css">
        <link rel="stylesheet" href="__STATIC__/css/add.css">

        <link href="__STATIC__/css/bootstrap.min.css" rel="stylesheet" />

        <!-- <link rel="stylesheet" href="__STATIC__/css/style.css" /> -->
        <link href="__STATIC__/css/bootstrap-theme.min.css" rel="stylesheet" />
        <script type="text/javascript" src="__STATIC__/js/jquery-1.10.2.js"></script>
        <script type="text/javascript" src="__STATIC__/js/bootstrap.min.js"></script>
        <!-- <link rel="stylesheet" href="__STATIC__/css/css.css" /> -->
        <!-- <link rel="stylesheet" href="__STATIC__/font-awesome/css/font-awesome.min.css" /> -->

        <style>
            html,body{width: 100%;height: 100%;}
            body{width:100%;height:100%;font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif;}
            .modal.fade .modal-dialog{transform: translate(0,0)}
            .float-none{float: none;}
            @media (max-width:1280px) {
                .ab-left,.ab-right{width: 18%;}
                .ab-left img,.ab-right img{width: 100%;}
                .app-brief{width:100%;}
                .app-icon-erweima{display:none;}
                .appicon{margin: auto;}
                .app-message{display:none;}
                .app-small h1{font-weight: 100;color: #505556;text-align: center;}
                .app-small h1 i{margin-right: 10px;}
                .app-brief-bot{margin: 10px 0 20px;}
                .app-small{display: block;}
                .bulletin p{margin-top: 10px;line-height: 20px;}
                .small-down{display:block;}
                .bulletin a{float: none;display:block;width:50px;margin: 20px auto;}
            }
        </style>
    </head>
    <body>
    <span class="ab-left">
        <img src="__STATIC__/images/download_pattern_left.png" alt="">
    </span>
    <span class="ab-right">
        <img src="__STATIC__/images/download_pattern_right.png" alt="">
    </span>
    <div class="weixin-open" id="weixin-open">
        <div class="weixin-hint">
             <p>点击右上角菜单<br>在默认浏览器中打开并安装应用</p>
             <img src="__STATIC__/images/open.png" alt="">
        </div>
    </div>
    <div class="app-brief">
        <div class="app-down-top">
            <div class="app-icon-erweima">
                <div class="appicon">
                <if condition="$list.zxlogo neq '' ">
                    <img src="__IMG__{$list.zxlogo}" class="img-rounded" width="119" height="118" />
                    <else />
                    <img src="data:image/png;base64,{$list.hslogo}" class="img-rounded" width="119" height="118" />
                </if>
            </div>
                <div class="down-qrcode">
                    <img src="__PUBLIC__/png/{$qrcode}.png" alt="二维码下载">
                </div>
            </div>
            <!-- 手机端app信息 star -->
            <div class="app-small">
                <div class="appicon">
                    <if condition="$list.zxlogo neq '' ">
                        <img src="__IMG__{$list.zxlogo}" class="img-rounded" width="119" height="118" />
                        <else />
                        <img src="data:image/png;base64,{$list.hslogo}" class="img-rounded" width="119" height="118" />
                    </if>
                </div>
                <h1><if condition="$list.ext eq 'ipa'">
                    <i class="fa fa-apple"></i>
                    <else/>
                    <i class="fa fa-android"></i>
                </if>
                    {$list.nickname}
                </h1>
            </div>
            <!-- 手机端app信息 end -->
            <div class="app-message">
                <h1>{$list.nickname}</h1>
                <p>扫描二维码下载<br>或用手机浏览器输入这个网址:&nbsp;&nbsp;<a href="/a/{$list['shorturl']}">http://{$_SERVER['SERVER_NAME']}/a/{$list.shorturl}</a></p>
            </div>
            <div class="app-brief-bot">
                <p>文件大小: {$list.zsize|formatBytes}<br>更新于:{$list.create_time|date='Y-m-d',###}</p>
            </div>
            <if condition="($list.aqpassword eq '') OR ($list.aqpassword eq $aqpassword)">
                        <div class="spinner" style="padding-top:20px;" redata="{$list.needmoney}">
                            <switch name="ispayed">
                                <case value="0">
                                    <a onclick="gotoopenurl('{$gopayurl}')" class="small-down"><i class="fa fa-download"></i> 购买￥{$list.needmoney}元</a>
                                </case>
                                <default />
                                <span id="checkinfo">
							<if condition="$list.ext eq 'ipa'">
								<a  onclick="gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}')"   id="ase" class="small-down"><i class="fa fa-download"></i> 点击安装</a>
							<elseif condition="($list.ext eq 'apk') and ($uptype eq '1')"/>

								<a onclick="gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}')" id="ase"  class="small-down"><i class="fa fa-download"></i> 点击安装</a>
							<elseif condition="($list.ext eq 'apk') and ($uptype eq '2')"/>
									<a onclick="gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}')" id="ase"  class="small-down"><i class="fa fa-download"></i> 点击安装</a>

							</if>
                            <!--<if condition="$list.ext eq 'ipa'">-->
							<!--<a onclick="gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}')" id="ase" class="small-down" ><i class="fa fa-download"></i> 点击安装</a>-->
                                <!--&lt;!&ndash;<a  onclick="gotoopenurl('{:U('Appipa/downloading',array('id'=>$list['id']))}')" class="btn-u btn-u-lg"><i class="fa fa-download"></i> 点击安装</a>&ndash;&gt;-->
							<!--<elseif condition="($list.ext eq 'apk') and ($uptype eq '1')"/>-->

								<!--<a onclick="gotoopenurl('{:U('Appipa/downloading',array('id'=>$list['id']))}')" class="small-down"><i class="fa fa-download"></i> 点击安装</a>-->
							<!--<elseif condition="($list.ext eq 'apk') and ($uptype eq '2')"/>-->
									<!--<a onclick="gotoopenurl('{:U('Appipa/downloading',array('id'=>$list['id']))}')" class="small-down"><i class="fa fa-download"></i> 点击安装</a>-->
							<!--</if>-->
						</span>
                            </switch>
                        </div>
                <else />
                    <div class="span12 margin-bottom-20" style="text-align:center;">
                        <div class="spinner" style="padding-top:20px; margin-bottom:150px;">
                            <form method="post" id="form" action="{:U('Appipa/checkpass')}">
                                <h2>请输入密码</h2>
                                <h4>该应用设置了安装密码,请输入密码继续</h4>
                                <input type="hidden" name="checkid" value="{$list.id}">
                                <input type="password" id="aqpassword" name="aqpassword" style="width:270px;"><br><br>
                                <button type="submit" id="submitButton" class="btn-u btn-u-green">立刻进入</button>
                            </form>
                        </div>
                    </div>
            </if>
            <!--<a href="downloading" class="small-down">点击下载</a>-->
        </div>
        <if condition="($list.ext eq 'apk' and $lists.ext eq 'ipa') or ($lists.ext eq 'apk' and $list.ext eq 'ipa')">
    <div class="classify-down">
        <!-- ios -->
        <if condition="$list.ext eq 'ipa' ">
        <div class="type">
            <i class="fa fa-apple"></i>
            <p>文件大小: {$list.zsize|formatBytes}
                <br>更新于: {$list.create_time|date='Y-m-d',###}</p>
        </div>
            <else />
            <div class="type">
                <i class="fa fa-android"></i>
                <p>当前版本: 2.3.0 (Build 1) 文件大小: {$list.zsize|formatBytes}
                    <br>更新于: {$list.create_time|date='Y-m-d',###}</p>
            </div>
        </if>
        <if condition="$lists.ext eq 'ipa' ">
            <div class="type">
                <i class="fa fa-apple"></i>
                <p>当前版本: 2.3.0 (Build 1) 文件大小: {$lists.zsize|formatBytes}
                    <br>更新于: {$list.create_time|date='Y-m-d',###}</p>
            </div>
            <else />
            <div class="type">
                <i class="fa fa-android"></i>
                <p>当前版本: 2.3.0 (Build 1) 文件大小: {$lists.zsize|formatBytes} MB
                    <br>更新于: {$lists.create_time|date='Y-m-d',###}</p>
            </div>
        </if>
        <!-- android -->
        <!--<div class="type">-->
            <!--<i class="fa fa-android"></i>-->
            <!--<p>当前版本: 2.3.0 (Build 1) 文件大小: {$lists.zsize|formatBytes} MB-->
                <!--<br>更新于: 2017-09-01 13:39</p>-->
        <!--</div>-->
        <div class="clear"></div>
    </div>
        </if>
    <div class="bulletin">
        <p>app之家 是应用内测平台，请自行甄别应用风险，如应用存在问题，可点击“举报”按钮<a href="javascript:;" id="reportClick" data-toggle="modal" >举报</a></p>
    </div>
    </div>
<!-- 登录 -->
<!-- Modal -->
<div class="modal fade top100" id="modifyphone" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">手机登录</h4>
            </div>
            <div class="modal-body">
                <div class="tabbb_box">
                    <form action="{:U('Login/loginphone')}" method="post" id="myphoneform" class="reg-page sky-form">
                        <!-- <div class="row"> -->
                        <div class="form-group">
                            <div class="font16 line32">手机号</div>
                            <input type="text" id="phone" name="phone" value="" placeholder="请输入您的手机号" class="col-md-12 col-xs-12 float-none">
                        </div>
                        <div class="form-group row">
                            <div class="font16 line32">验证码</div>
                            <input type="text" id="checkcode88" name="checkcode88" placeholder="请输入验证码" class="col-md-7 col-xs-7">
                            <button class="btn-u col-md-4 col-xs-4" type="button" id="sendcode88" onclick="sendcode8899()">发送验证码</button>
                        </div>
                        <div style="clear:both;"></div>
                        <!-- </div> -->
                    </form>
                </div>
            </div>
            <div class="modal-footer">
                <a href="javascript:;" class="page" data-dismiss="modal" onclick="xiugaiphone()">登录</a>
            </div>
        </div>
    </div>
</div>

<!-- 举报 -->
<div class="modal fade" id="reportApp" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">举报该应用</h4>
                </div>
                     <form id="formReport" class="sky-form" name="formReport" method="POST" novalidate="novalidate"  enctype="multipart/form-data" action="{:U('Login/jubao_act')}">
                     <input type="hidden" name="appid" value="{$list.id}">
                        <div class="modal-body" style="background:#f2f2f2">
                            <section>
                            <div style="padding:0 15px 20px 15px; margin-bottom:30px; border-bottom: 1px solid #ccc;">
                                作为一个第三方内测分发平台，我们一直致力于打击违规应用，保护知识产权。非常感谢您的举报，我们会在第一时间安排专人处理您举报的问题，并在处理之后向您反馈处理结果。<br /><br />感谢您对我们的支持，如果有更多问题欢迎拨打我们的热线电话：4008660210                        </div>
                            <section>
                            <section style="overflow: hidden;">
                                <div class="col-md-2" style="padding-top:6px;">
                                    你的邮箱                            </div>
                                <div class="col-md-10">
                                    <input class="form-control" name="arEmail" style="height:34px" type="text" id="arEmail" placeholder="Email" />
                                </div>
                            </section>
                            <section style="overflow: hidden;">
                                <div class="col-md-2"  style="padding-top:2px;">
                                    举报原因                            </div>
                                <div class="col-md-10">
                                <div class="row">
                                <div class="col-md-3">
                                    <label class="radio-inline">
                                        <input type="radio" name="arType" checked="checked" value="盗版"> 盗版                                </label>
                                </div>
                                <div class="col-md-3">
                                    <label class="radio-inline">
                                        <input type="radio" name="arType"  value="色情"> 色情                                </label>
                                </div>
                                <div class="col-md-3">
                                    <label class="radio-inline">
                                        <input type="radio" name="arType"  value="欺诈"> 欺诈                                </label>
                                </div>
                                <div class="col-md-3">
                                    <label class="radio-inline">
                                        <input type="radio" name="arType"  value="其他"> 其他                                </label>
                                </div>
                                </div>
                                </div>
                            </section>
                            <section style="overflow: hidden;">
                                <div class="col-md-12">
                                    <textarea class="form-control" rows="5" name="arContent" id="arContent" placeholder="补充举报原因，为了让您的举报能够尽快被处理，请尽可能提供详细的信息。"></textarea>
                                </div>
                            </section>
                            <section id="fileList">

                            </section>
                            <section style="padding-bottom:20px;">
                                <div class="col-md-12">
                                <!-- <a href="javascript:void(0);" id="uploader-files" class="btn btn-danger btn-xs" style="color:#fff !important; background:#56bc94 !important; border:0px !important; margin-top:-3px">上传附件</a> -->
                                <!-- <span id="loading"><img src="__STATIC__/images/spin.gif" style="width:20px;height:auto;"></span> -->
                                </div>
                            </section>
                        </div>
                        <div class="modal-footer" style="margin-top:0px">
                            <input type="hidden" name="shortcutUrl" value="uqCy" />
                            <a data-dismiss="modal" href="javascript:void(0)" class="btn btn-u btn-u btn-u-default" id="cancle">取消</a>
                            <button type="submit" id="btnReport" class="btn btn-u btn-sm">举报该应用</button>
                        </div>
                    </form>
            </div>
        </div>
    </div>


<script language="javascript">
    function xiugaiphone(){
        $('#myphoneform').submit();
    }
    var countdown=60;
    function settime(){
        if (countdown == 0) {
            $("#sendcode88").attr("disabled",false);
            $("#sendcode88").html("发送验证码");
            countdown = 60;
            return;
        } else {
            $("#sendcode88").attr("disabled",true);
            $("#sendcode88").html("重新发送(" + countdown + ")");
            countdown--;
        }
        setTimeout(function() {
        settime() }
        ,1000)
    }
    function sendcode8899(){
        $("#sendcode88").attr("disabled",true);
        var phone = $('#phone').val();
        if(phone){
            $.ajax({
                url: '/index.php/login/sendemailcode88',
                type: 'post',
                data: {phone : phone},
                dataType: 'json',
                beforeSend: function() {
                },
                complete: function() {

                },
                success: function(json) {
                    if(json['code']==1){
                        settime();
                        return false;
                    }else{
                        alert(json['msg']);
                        $("#sendcode88").attr("disabled",false);
                        return false;
                    }
                }
            });
        }else{
            alert("请输入手机号码");
            $("#sendcode88").attr("disabled",false);
            return false;
        }
    }
    </script>
    </body>
</html>
<script>
    $(function(){
        $('#reportClick').click(function () {
        $('#reportApp').modal('show');
    });
    })
    function isWeiXin(){
        var ua = window.navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i) == 'micromessenger'){
            return true;
        }else{
            return false;
        }
    }
    if(isWeiXin()){
      document.getElementById("weixin-open").style.display="block";
      }else{

        document.getElementById("weixin-open").style.display="none";
    }
    window.onload =(function(){
        $("#ase").click(function(){
            gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}');
            setTimeout(function(){  //使用  setTimeout（）方法设定定时2000<a href="https://www.baidu.com/s?wd=%E6%AF%AB%E7%A7%92&tn=44039180_cpr&fenlei=mv6quAkxTZn0IZRqIHckPjm4nH00T1YLn1R1PW6dPH6YPAnsPW6v0ZwV5Hcvrjm3rH6sPfKWUMw85HfYnjn4nH6sgvPsT6KdThsqpZwYTjCEQLGCpyw9Uz4Bmy-bIi4WUvYETgN-TLwGUv3EnHf4PWmsrHRdnWckPWnkrHmkrf" target="_blank" class="baidu-highlight">毫秒</a>
                gotoopenurl('{:U('Appipa/downloading',array('id'=>$list['id']))}');
            },2000);
        });
//   $("#ase").trigger("click");
        //  gotoopenurl('{:U('Index/down',array('id'=>$list['id']))}');
    });
    function gotoopenurl(url){
        if(isWeiXin()){
            alert("请点击微信右上角按钮，然后在弹出的菜单中，点击在浏览器中打开，即可安装");
        }else{
        <if condition="($userid neq '0') OR ($ispayed eq 1)">
            window.location.href = url;
        <else />

            $('#modifyphone').modal('show');
        </if>
        }
    }
</script>
<script>
    $(function(){
        var browser = {
            versions: function() {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {
                    trident: u.indexOf('Trident') > -1,
                    presto: u.indexOf('Presto') > -1,
                    webKit: u.indexOf('AppleWebKit') > -1,
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/),
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
                    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1,
                    iPad: u.indexOf('iPad') > -1,
                    webApp: u.indexOf('Safari') == -1
                };
            }()
        }
        if(is_weixin())
        {
            if(browser.versions.ios || browser.versions.iPhone || browser.versions.iPad){
                $('#weixin').show();
            }else{
                $('#weixin_an').show();
            }
        }
        var os_type =  2;
        if(browser.versions.ios || browser.versions.iPhone || browser.versions.iPad){
            if(os_type == 2){
                $('#down2').show();
            }else{
                $('#down2').hide();
                $('#down_tip').show().html('请使用安卓设备安装');
            }
        }else if(browser.versions.android){
            if(os_type == 1){
                $('#down2').show();
            }else{
                $('#down2').hide();
                $('#down_tip').show().html('请使用IOS设备安装');
            }
        }
    })
    function ajaxTj()
    {
        var browser = {
            versions: function() {
                var u = navigator.userAgent, app = navigator.appVersion;
                return {
                    trident: u.indexOf('Trident') > -1,
                    presto: u.indexOf('Presto') > -1,
                    webKit: u.indexOf('AppleWebKit') > -1,
                    gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1,
                    mobile: !!u.match(/AppleWebKit.*Mobile.*/) || !!u.match(/AppleWebKit/),
                    ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),
                    android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1,
                    iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1,
                    iPad: u.indexOf('iPad') > -1,
                    webApp: u.indexOf('Safari') == -1
                };
            }()
        }
        var tip_val = $('#ios_tips').val();
        if(tip_val ==1){
            $('.pos_all').css('display','block');
            $('#pos_inherit').addClass('pos_inherit');

        }
        if(!is_weixin())
        {
                            if(browser.versions.ios || browser.versions.iPhone || browser.versions.iPad){
                $("#down2").hide();
                $("#down_loading").show().delay(5000).fadeOut(100);
                $("#install_tips").hide().delay(5000).fadeIn(200);
            }
                        }
        $.ajax({
            type: "GET",
            url:'/app/tj',
            data: {package_key:'98d0f7fc5457ddb0777534f47adb9119'},
            success: function(msg){
                if(msg == 1)
                {
                    $('#down1').attr('href','#');
                    $("#down1").attr("target", "");
                    $('#down2').attr('href','');
                    $("#down2").attr("target", "#");
                }
            }
        });
    }
    function is_weixin(){
        var ua = navigator.userAgent.toLowerCase();
        if(ua.match(/MicroMessenger/i)=="micromessenger") {
            return true;
        } else {
            return false;
        }
    }
    $(function() {
        $('.close_ios9').click(function(){
            $('.pos_all').css('display','none');
            $('#pos_inherit').removeClass('pos_inherit');
        });
        $("#btnFk").on("click", function() {
            $('#btncontact').css('display', 'block');
            $('#btnFk').css('display', 'none');
            $("#feedback_content_box").slideDown(600);
            $("#feedback_content_box").animate({top: 0}, 600);
            $("#feedback_content_box").focus();
        });
        $("#submit").on("click", function() {
            var contact = $('#btncontact').val().trim();
            var content = $('textarea').val().trim();
            var app_key = "3c4f68eaf91d14a5b16a9129f0ffba0f";
            var app_name = "定转爆粉";
            var url = '/feedback/add';
            if(!content || content == '反馈内容'){
                $("#content_tips").css({display:'block'});
                return false;
            }
            $('#toggle').css('display', 'none');
            $('#content_tips').css('display', 'none');
            $("#feedback_content_box").slideUp(600);
            $("#feedback_content_box").animate({ top: 20 }, 600);
            if( !contact || contact == 'Email/QQ/微信/电话' ){
                contact = '匿名';
            }
            $.post(url,{contact:contact,content:content,app_key:app_key,app_name:app_name},function(msg){
                if(msg){
                    $('#for_tips,textarea,#btnFk,#submit').css({display:'none'})
                }else{
                    $('.feedback_tip').text('提交失败，请 <a href="/site/contact">吐槽</a>');
                }
                $('.feedback_tip').css({display:'block'})
            },'json')
        });
    })
</script>
